<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>添加企业客户</title>
<script type="text/javascript">
/**
 * 选择省市区，触发变化，表单参数值传入隐藏域
 */
function areaOnChange(obj,str){
	var $obj = $(obj);
	var text = $obj.find("option:selected").text();
	$("#"+str).val(text); 
}

//图片上传的初始化
$('#uploadify').uploadify({
	'uploader' : 'uploadify/scripts/uploadify.swf',
	'script' : 'picUploadify', //指定服务端处理类的入口
	'folder' : 'upload/image',
	'cancelImg' : 'uploadify/cancel.png',
	'fileDataName' : 'uploadify', //和input的name属性值保持一致就好，Struts2就能处理了   
	'queueID' : 'fileQueue',
	'auto' : true,//是否选取文件后自动上传   
	'multi' : false,//是否支持多文件上传
	'simUploadLimit' : 1,//每次最大上传文件数   
	'fileDesc' : '.jpg文件或.gif文件或.png文件',//上传文件类型说明
	'fileExt' : '*.jpg;*.gif;*.png',
	'wmode' : 'transparent', //隐藏进度条
	'displayData' : 'percentage',//有speed和percentage两种，一个显示速度，一个显示完成百分比    
	'onComplete' : function(event, queueID, fileObj, response, data) {
		$("#picPath").val(response);
		$("#imgpath").html("<img src='"+response+"' />");
	}
});


//图片上传的初始化
$('#uploadify2').uploadify({
	'uploader' : 'uploadify/scripts/uploadify.swf',
	'script' : 'picUploadify', //指定服务端处理类的入口
	'folder' : 'upload/image',
	'cancelImg' : 'uploadify/cancel.png',
	'fileDataName' : 'uploadify', //和input的name属性值保持一致就好，Struts2就能处理了   
	'queueID' : 'fileQueue',
	'auto' : true,//是否选取文件后自动上传   
	'multi' : false,//是否支持多文件上传
	'simUploadLimit' : 1,//每次最大上传文件数   
	'fileDesc' : '.jpg文件或.gif文件或.png文件',//上传文件类型说明
	'fileExt' : '*.jpg;*.gif;*.png',
	'wmode' : 'transparent', //隐藏进度条
	'displayData' : 'percentage',//有speed和percentage两种，一个显示速度，一个显示完成百分比    
	'onComplete' : function(event, queueID, fileObj, response, data) {
		$("#picPath2").val(response);
		$("#imgpath2").html("<img src='"+response+"' />");
	}
});

//图片上传的初始化
$('#uploadify3').uploadify({
	'uploader' : 'uploadify/scripts/uploadify.swf',
	'script' : 'picUploadify', //指定服务端处理类的入口
	'folder' : 'upload/image',
	'cancelImg' : 'uploadify/cancel.png',
	'fileDataName' : 'uploadify', //和input的name属性值保持一致就好，Struts2就能处理了   
	'queueID' : 'fileQueue',
	'auto' : true,//是否选取文件后自动上传   
	'multi' : false,//是否支持多文件上传
	'simUploadLimit' : 1,//每次最大上传文件数   
	'fileDesc' : '.jpg文件或.gif文件或.png文件',//上传文件类型说明
	'fileExt' : '*.jpg;*.gif;*.png',
	'wmode' : 'transparent', //隐藏进度条
	'displayData' : 'percentage',//有speed和percentage两种，一个显示速度，一个显示完成百分比    
	'onComplete' : function(event, queueID, fileObj, response, data) {
		$("#picPath3").val(response);
		$("#imgpath3").html("<img src='"+response+"' />");
	}
});

</script>
</head>
<body>
	<div class="pageContent">
		<form class="pageForm required-validate" method="post" action="addCompanyUserAction.action" onsubmit="return validateCallback(this, navTabAjaxDone);">
			<input type="hidden" name="rightId" value="${rightId}" />
			<div class="pageFormContent" layoutH="56">
				<table>

					<tr>
						<td>公司代号：</td>
						<td><input name="companyCode" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>省市区：</td>
						<td><select onChange="areaOnChange(this,'provinceName')" class="combox" name="provinceId" ref="combox_city" refUrl="getAreasNolimitAction.action?parentId={value}">
								<option value="" >不限</option>
								<c:forEach items="${areaList}" var="li">
									<option value="${li.id}">${li.name}</option>
								</c:forEach>
						</select> <select onChange="areaOnChange(this,'cityName')" class="combox" name="cityId" id="combox_city" ref="combox_area" refUrl="getAreasNolimitAction.action?parentId={value}">
						</select> <select onChange="areaOnChange(this,'districtName')" class="combox" name="districtId" id="combox_area">
						</select></td>
					</tr>
					<tr>
						<td>详细地址：</td>
						<td><input name="address" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>公司名称：</td>
						<td><input name="companyname" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					<tr>
						<td>公司电话：</td>
						<td><input name="companyTel" type="text" size="30" class="required textInput valid" /></td>
					</tr>
<!-- 					<tr>
						<td>公司余额：</td>
						<td><input name="company_Balance" type="text" size="30" class="required textInput valid" /></td>
					</tr> -->
					<tr>
						<td>支付确认码：</td>
						<td><input name="payPassword" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>联系人名称：</td>
						<td><input name="companyBoss" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>联系人电话：</td>
						<td><input name="bossMobile" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>联系人邮箱：</td>
						<td><input name="bossEmail" type="text" size="30" class="required textInput valid" /></td>
					</tr>
<!-- 					<tr>
						<td>图片1：</td>
						<td><input name="photoUrl1" type="text" size="30" class="required textInput valid" /></td>
					</tr>
					
					<tr>
						<td>图片2：</td>
						<td><input name="photoUrl2" type="text" size="30" class="required textInput valid" /></td>
					</tr>
				
					<tr>
						<td>图片3：</td>
						<td><input name="photoUrl3" type="text" size="30" class="required textInput valid" /></td>
					</tr>
 -->	
					
										<tr>
						<td>图片1：</td>
						<td><input type="file" name="uploadify" id="uploadify" /> 
						<input id="picPath" type="hidden" name="photoUrl1" />(不能为空)
					</tr>
					<tr>
						<td colspan="2">
							<div id="imgpath"></div>
						</td>
					</tr>
					<tr>
						<td>图片2：</td>
						<td><input type="file" name="uploadify2" id="uploadify2" /> 
						<input id="picPath2" type="hidden" name="photoUrl2" />(不能为空)
					</tr>
					<tr>
						<td colspan="2">
							<div id="imgpath2"></div>
						</td>
					</tr>
					<tr>
						<td>图片3：</td>
						<td><input type="file" name="uploadify3" id="uploadify3" /> 
						<input id="picPath3" type="hidden" name="photoUrl3" />(不能为空)
					</tr>
					<tr>
						<td colspan="2">
							<div id="imgpath3"></div>
						</td>
					</tr>
					<tr>
						<td>是否可用：</td>
						<td><select   name="locked" style="width: 120px">
								<option value="0">禁用</option>
								<option value="1">启用</option>							
						</select></td>
					</tr>

				
				</table>
				<!--传参 -->
				<div>
					<input id="provinceName" type="hidden" name="provinceName" class="required textInput valid"> <input id="cityName" type="hidden" name="cityName" class="required textInput valid"> <input id="districtName" type="hidden" name="districtName" class="required textInput valid">
				</div>
					
			</div>
			<div class="formBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">保存</button>
							</div>
						</div></li>
					<li>
						<div class="button">
							<div class="buttonContent">
								<button type="button" class="close">取消</button>
							</div>
						</div></li>
				</ul>
			</div>
		</form>
	</div>
</body>
</html>